<ion-view view-title="本月账单" class="stable-bg">
    <ion-content overflow-scroll="true" style="overflow:auto;">
        <ion-refresher pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
        <ion-list class="bill_list">
            <div class="state-bg maibei-order-img" collection-repeat="bill in billList.data">
                <div class="order-margin"></div>
                <div class="light-bg">
                    <h5 class="order-maibei">订单完成
                        <span class="order-maibei-time"> - {{bill.consume_date}}</span>
                        <span class="maibei-right order-maibei-type" ng-if="bill.repay_type == 1">次月还款</span>
                        <span class="maibei-right order-maibei-type" ng-if="bill.repay_type == 2">分期还款</span>
                    </h5>
                    <ion-item class="item-thumbnail-left">
                        <img ng-if="bill.merchant_logo" ng-src="{{img_url}}{{bill.merchant_logo}}">
                        <img ng-if="!bill.merchant_logo" ng-src="img/66.png">
                        <p class="title">{{bill.merchant_name}}</p>
                        <div class="maibei-p maibei-font-min">
                            <div>消费总额<span class="maibei-right" ng-if="bill.total_amount">￥{{bill.total_amount/100}}</span></div>
                            <div>优惠金额<del class="maibei-right" ng-if="bill.discount">￥{{bill.discount/100}}</del></div>
                            <div>本月应还<span class="maibei-right" ng-if="bill.repay_amount">￥{{bill.repay_amount/100}}</span></div>
                            <div>逾期金额<span class="maibei-right maibei-yuqi" ng-if="bill.fine">￥{{bill.fine/100}}</span></div>
                            <div class="maibei-right maibei-yinghuan">{{bill.repay_date}} 前应还 <span class="maibei-money" ng-if="bill.all_pay">￥{{bill.all_pay/100}}</span></span></div>
                        </div>
                    </ion-item>
                    <div class="padding maibei-center-button">
                        <button class="button button-outline button-maibei"
                                ng-click="payOrder(bill)">立即还款</button>
                    </div>
                </div>
            </div>
        </ion-list>
        <ion-infinite-scroll on-infinite="loadMore()" distance="1%" ng-if="billList.has_next_page == '1'"></ion-infinite-scroll>
    </ion-content>
</ion-view>
